<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>


<div>
	<sec:authorize access="isAnonymous()">
		<form class="signin" action="j_spring_security_check" method="post">
			<fieldset>
				<div>
					<label for="j_username">Username or Email</label> <input id="email"
						type="text" name="j_username" />
				</div>
				<div>
					<label for="j_password">Password</label> <input id="pass"
						type="password" name="j_password" />
				</div>
				<input id="remember_me" type="checkbox" value="1"
					name="_spring_security_remember_me" /> <label for="remember_me">Remember
					me</label> <small> <a href="/account/resend_password">Forgot?</a>
				</small> <input id="submit" type="submit" value="Sign In!" name="commit" />
			</fieldset>
		</form>
		<div class="notify">
			Want an account? <br /> <a class="join"
				href="<s:url value="/spitters?new"/>">Join for Free!</a> <br />
			It's fast and easy!
		</div>
	</sec:authorize>

	<sec:authorize access="isAuthenticated()">
	<sec:authentication property="principal.username" var="username"/>
		<h2>Hi <a href=<c:url value="/spitters/${username}"/> >${username}!</a></h2>
		<h3><a href=<c:url value="/spittles/new"/> >Post a spittle</a></h3>
		<s:url value="/resources/images" var="images_url" />
		<%-- <img src="${images_url}/spitter_me.jpg" align="middle" /> 
	--%>
		<br />
		<a href="<c:url value="/j_spring_security_logout" />">Logout</a>
	</sec:authorize>

</div>